#include <stdio.h>
#define MAX 255

int main() {
    int a[MAX] = {0, 2, 4, 6, 8}, asize = 5;
    int b[MAX] = {1, 3, 6, 7, 9, 11}, bsize = 6;
    int c[MAX], csize = 0;
    int i, j;

    printf("Array A: ");
    for (i = 0; i < asize; i++) {
        printf("%d ", a[i]);
    }
    printf("\nArray B: ");
    for (i = 0; i < bsize; i++) {
        printf("%d ", b[i]);
    }
    i = j = 0;
    while (i < asize && j < bsize) {
        if (a[i] > b[j]) {
            c[csize++] = b[j++];
        } else {
            c[csize++] = a[i++];
        }
    }
    while (i < asize) {
        c[csize++] = a[i++];
    }
    while (j < bsize) {
        c[csize++] = b[j++];
    }
    printf("\nMerged: ");
    for (i = 0; i < csize; i++) {
        printf("%d ", c[i]);
    }

    printf("\n");
    return 0;
}
